home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr26 / netprog.zip / NETPROG.TAR / asyncio / oldcat.c < prev   
C/C++ Source or Header  |  1989-12-17  |  268b  |  21 lines

  1. /*
  2.  * Copy standard input to standard output.
  3.  */
  4.  
  5. #define    BUFFSIZE    4096
  6.  
  7. main()
  8. {
  9.     int        n;
  10.     char        buff[BUFFSIZE];
  11.  
  12.     while ( (n = read(0, buff, BUFFSIZE)) > 0)
  13.         if (write(1, buff, n) != n)
  14.             err_sys("write error");
  15.  
  16.     if (n < 0)
  17.         err_sys("read error");
  18.  
  19.     exit(0);
  20. }
  21.